package model

import (
	"gorm.io/gorm"
)

type ChatHistory struct {
	Id          uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	FormUserId  uint           `gorm:"column:form_user_id;type:bigint(20) UNSIGNED;not null;" json:"form_user_id"`
	ToUserId    uint           `gorm:"column:to_user_id;type:bigint(20) UNSIGNED;not null;" json:"to_user_id"`
	RoomId      uint           `gorm:"column:room_id;type:bigint(20) UNSIGNED;not null;" json:"room_id"`
	Content     string         `gorm:"column:content;type:varchar(50);not null;" json:"content"`
	ContentsNum uint           `gorm:"column:contents_num;type:bigint(100);not null;" json:"contents_num"`
	CreatedAt   gorm.DeletedAt `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
}

func (c *ChatHistory) TableName() string {
	return "chat_history"
}
